﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using miSuperEngine;

namespace juego1
{
    public class Enemigo:Actor
    {
        public Enemigo(Vector2 _pos, Animation an)
            : base(_pos, an)
        {
            position=_pos;
            anim = an;

            speed = new Vector2(SceneManager.rand.Next(-3, -1), SceneManager.rand.Next(-2, 2));
            acceleration = new Vector2(0, 0);
        }
        public override void update(GameTime gt)
        {
            rotation++;
            if (position.X < -anim.getRect().Width)
                position.X = SceneManager.screenSize.X;
            if (position.Y < anim.getRect().Height / 2 || position.Y > SceneManager.screenSize.Y - anim.getRect().Height / 2)
                speed.Y *= -1;
            base.update(gt);
        } 
    }
}
